  <script type="text/javascript">

jq(function(){


origPostButton = jq("#savebuttid"), buttonParent = origPostButton.parent(), myPostButton = jq('<a id="mysavebuttid" name="dobutton" href="#none" class="button"><span>Close Books</span><span class="rb">&nbsp;</span></a>');
origPostButton.hide();
buttonParent.prepend(myPostButton);
myPostButton.get(0).data = origPostButton.get(0).data;


myPostButton.click(function() {     

  if (!myPostButton.get(0).data) {

                            console.log("WARNING No button data. Doing default post");
                            editor.submit(true, "save");
                        } else {

var answer = confirm("Warning: Please ensure that all depreciation schedules in process of posting have completed before closing the period.\nIf depreciation schedules are still in process, please cancel this operation. Books may be closed when all depreciation schedules have completed posting.");
if(answer)
{
console.log("Posting transaction");
                            editor.submit(myPostButton.get(0).data.serverAction, myPostButton.get(0).data.action, myPostButton.get(0).data.xyz, myPostButton.get(0).data.args);
}
else
{}
                                                   }               
        });
}); 

</script>